using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_PatStatementMap : EntityTypeConfiguration<so_PatStatement>
    {
        public so_PatStatementMap()
        {
            // Primary Key
            this.HasKey(t => new { t.sumfields, t.dimfields });

            // Properties
            this.Property(t => t.Patient__)
                .HasMaxLength(10);

            this.Property(t => t.Document_Type)
                .HasMaxLength(8);

            this.Property(t => t.Payment_Type)
                .HasMaxLength(20);

            this.Property(t => t.Document_id)
                .HasMaxLength(8);

            this.Property(t => t.Number)
                .HasMaxLength(20);

            this.Property(t => t.Doctor)
                .HasMaxLength(35);

            this.Property(t => t.noteS)
                .HasMaxLength(130);

            this.Property(t => t.batch)
                .HasMaxLength(8);

            this.Property(t => t.HeaderView)
                .HasMaxLength(47);

            this.Property(t => t.sumfields)
                .IsRequired()
                .HasMaxLength(22);

            this.Property(t => t.dimfields)
                .IsRequired()
                .HasMaxLength(1);

            // Table & Column Mappings
            this.ToTable("so_PatStatement");
            this.Property(t => t.Patient__).HasColumnName("Patient_#");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Document_Type).HasColumnName("Document_Type");
            this.Property(t => t.voucher).HasColumnName("voucher");
            this.Property(t => t.Payment_Type).HasColumnName("Payment_Type");
            this.Property(t => t.Document_id).HasColumnName("Document_id");
            this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.related_bill_of_payment).HasColumnName("related_bill_of_payment");
            this.Property(t => t.Doctor).HasColumnName("Doctor");
            this.Property(t => t.noteS).HasColumnName("noteS");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.BASE_1).HasColumnName("BASE_1");
            this.Property(t => t.BASE_2).HasColumnName("BASE_2");
            this.Property(t => t.batch).HasColumnName("batch");
            this.Property(t => t.HeaderView).HasColumnName("HeaderView");
            this.Property(t => t.sumfields).HasColumnName("sumfields");
            this.Property(t => t.dimfields).HasColumnName("dimfields");
        }
    }
}
